package cn.tsinghua.comsmacitccntsinghua.utils;

import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;

/**
 * @Author yjl
 * @create 2021/11/8 11:10
 */
public class AndroidUtil {

    String TAG = "AndroidUtil";
    public static String getUID(Context context){
        String uid = "";
        PackageManager packageManager = context.getPackageManager();
        ApplicationInfo ai = null;
        try {
            ai = packageManager.getApplicationInfo("cn.tsinghua.comsmacitccntsinghua", PackageManager.GET_META_DATA);
            uid = String.valueOf(ai.uid);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
        return uid;
    }
}
